<!doctype html>
<!doctype html>
<html lang="">
<head>
    <meta charset="UTF-8">
    <title>课程选择子系统</title>
    <script src="/static/js/jquery.js"></script>
    <link href="/static/css/font-awesome.css" rel="stylesheet">
    <link href="/static/css/bootstrap.css" rel="stylesheet">
    <link href="/static/css/style-responsive.css" rel="stylesheet">
    <link href="/static/css/default-theme.css" rel="stylesheet">
    <link href="/static/css/style.css" rel="stylesheet">
    <link href="/static/css/bootstrap-reset.css" rel="stylesheet">
</head>
<body class="sticky-header">
<section>
    <div class="sidebar-left">
        <div class="sidebar-left-info">
            <div class=" search-field"></div>
            <ul class="nav nav-pills nav-stacked side-navigation">
                <li class="menu-list nav-active"><a href=""><i class="fa fa-drivers-license"></i> <span>学生界面</span></a>
                    <ul class="child-list">
                        <li><a href={% url '培养方案定制' %}>培养方案定制</a></li>
                        <li><a href={% url '课程选择' %}>课程选择</a></li>
                        <li><a href={% url '选课结果-学生' %}>选课结果</a></li>
                    </ul>
                </li>
                <li class="menu-list "><a href=""><i class="fa fa-file-text"></i> <span>教师界面</span></a>
                    <ul class="child-list">
                        <li><a href={% url '选课结果-教师' %}>选课结果</a></li>
                    </ul>
                </li>
                <li class="menu-list"><a href=""><i class="fa fa-shopping-cart"></i> <span>管理员界面</span></a>
                    <ul class="child-list">
                        <li><a href={% url '选课时间设定' %}>选课时间设定</a></li>
                        <li><a href={% url '学生补选' %}>学生补选</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="body-content">
        <div class="header-section">
            <div class="logo dark-logo-bg"><a href={% url 'index' %}> <img src="/static/img/logo-icon.png" alt="">
                <!--<i class="fa fa-maxcdn"></i>-->
                <span class="brand-name" style="font-size: 15px; font-weight: bold;">课程选择子系统</span> </a></div>
            <div class="icon-logo dark-logo-bg hidden-xs hidden-sm"><a href={% url 'index' %}><img
                    src="/static/img/logo-icon.png" alt=""> </a></div>
            <a class="toggle-btn"><i class="fa fa-outdent"></i></a>
            <div class="kouhao">课程选择子系统</div>
            <div class="notification-wrap">
                <div class="right-notification">
                    <ul class="notification-menu">
                        <li class="dropdown">
                            <a href="javascript:" data-toggle="dropdown" class="dropdown-toggle" aria-expanded="false">
                                <i class="fa  fa-cogs"></i> 账号设置 <b class=" fa fa-angle-down"></b></a>

                            <ul role="menu" class="dropdown-menu language-switch">
                                <li>
                                    <a href="修改密码.html">修改密码</a>
                                </li>

                            </ul>

                        </li>
                        <li class="dropdown">
                            <a href="javascript:" data-toggle="dropdown" class="dropdown-toggle" aria-expanded="false">
                                <i class="fa  fa-cogs"></i> 返回主界面 <b class=" fa fa-angle-down"></b></a>

                            <ul role="menu" class="dropdown-menu language-switch">
                                <li>
                                    <a href="主界面.html">返回主界面</a>
                                </li>

                            </ul>

                        </li>
                        <li><a href="登录.html" class="btn btn-default  dropdown-toggle"> <i class="fa fa-sign-out"></i>退出登录
                        </a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="page-head">
            <ol class="breadcrumb">
                <li><a href="#">管理员界面</a></li>
                <li class="active">学生补选</li>
            </ol>
            <h3><strong>当前学生：</strong> {{ n_s.name }} <strong>账号：</strong>{{ n_s.account }}</h3>
        </div>
        {% if messages %}
            <script>
                {% for msg in messages %}
                    alert('{{ msg.message }}');
                {% endfor %}
            </script>
        {% endif %}
        <div class="wrapper">
            <div class="panel">
                <div class="panel-body">
                    <div class="form1 searchbox">
                        <ul class="row">
                            <form action="" method="post">
                                {% csrf_token %}
                                <li class="col-xs-2"><span>学生姓名：</span><label>
                                    <input type="text" class="form-control" name="student_name">
                                </label></li>
                                <li class="col-xs-2"><span>学生账号：</span><label>
                                    <input type="text" class="form-control" name="account">
                                </label></li>
                                <li class="col-xs-2"><span>学生院系：</span><label>
                                    <input type="text" class="form-control" name="college">
                                </label></li>
                                <li class="col-xs-2" style="padding-left: 0"><span>搜索学生：</span>
                                    <button type="submit" name="student" value="1" class="btn btn-primary">学生搜索</button>
                                </li>
                            </form>
                        </ul>
                        <ul class="row">
                            <form action="" method="post">
                                {% csrf_token %}
                                <li class="col-xs-2"><span>课程ID：</span><label>
                                    <input type="text" class="form-control" name="ID">
                                </label></li>
                                <li class="col-xs-2"><span>课程名称：</span><label>
                                    <input type="text" class="form-control" name="lesson_name">
                                </label></li>
                                <li class="col-xs-2"><span>教师姓名：</span><label>
                                    <input type="text" class="form-control" name="teacher_name">
                                </label></li>
                                {{ form.as_table }}

                                <li class="col-xs-2" style="padding-left: 0"><span>课程搜索：</span>
                                    <button type="submit" name="course" value="1" class="btn btn-primary">课程搜索</button>
                                </li>
                            </form>
                        </ul>
                    </div>
                    <table class="table m-t-20">
                    {% if c_bit == 1 %}
                        <tr>
                            <th>课程ID</th>
                            <th>课程名称</th>
                            <th>课程学分</th>
                            <th>课程地点</th>
                            <th>课程时间</th>
                            <th>教师姓名</th>
                            <th>学期</th>
                            <th>剩余容量/总量</th>
                            <th>操作</th>
                        </tr>
                        {% for item,c,ar,ad,core in data %}
                            <tr>
                                <td>{{ item.Course_id }}</td>
                                <td>{{ item.name }}</td>
                                <td>{{ item.credit }}</td>
                                <td>{{ ad.ClassRoom_Name }}</td>
                                {% if ar.Course_week == 1 %}
                                    <td>星期一 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% elif ar.Course_week == 2 %}
                                    <td>星期二 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% elif ar.Course_week == 3 %}
                                    <td>星期三 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% elif ar.Course_week == 4 %}
                                    <td>星期四 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% elif ar.Course_week == 5 %}
                                    <td>星期五 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% elif ar.Course_week == 6 %}
                                    <td>星期六 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% else %}
                                    <td>星期天 {{ ar.Course_beg }}-{{ ar.Course_end }}节</td>
                                {% endif %}
                                <td>{{ item.teacher_name }}</td>
                                <td>{{ item.term }}</td>
                                <td><span style="color: #FF0000; ">{{ c.now_capacity }}</span> /{{ item.capacity }}</td>
                                <form action="" method="post">
                                    {% csrf_token %}
                                    <td>
                                        <button type="submit" name="Choose" class="btn btn-primary"
                                                value={{ item.Course_id }}>补选
                                        </button>
                                    </td>
                                </form>
                            </tr>
                        {% endfor %}
                    {% else %}
                        <tbody>
                        <tr>
                            <th>学生姓名</th>
                            <th>学生账号</th>
                            <th>学生邮箱</th>
                            <th>学生院系</th>
                            <th>学生电话</th>
                            <th>操作</th>
                        </tr>
                        {% for item in data %}
                            <tr>
                                <td>{{ item.name }}</td>
                                <td>{{ item.account }}</td>
                                <td>{{ item.emailbox }}</td>
                                <td>{{ item.college }}</td>
                                <td>{{ item.phonenumber }}</td>
                                <form action="" method="post">
                                    {% csrf_token %}
                                    <td>
                                        <button type="submit" name="Choose_s" class="btn btn-primary"
                                                value={{ item.account }}>选择
                                        </button>
                                    </td>
                                </form>
                            </tr>
                        {% endfor %}
                    {% endif %}
                    </tbody></table>
                    </div>
                </div>
            </div>
        </div>
</section>
<!-- Modal -->
<script src="/static/js/bootstrap.js"></script>
<script src="/static/js/echarts.min.js"></script>
<script src="/static/js/scripts.js"></script>
<script src="/static/laydate/laydate.js"></script>
</body>
</html>
